Word processing computer application programs are a well-known means for processing text information in a computer system. An example of a word processing program is the Microsoft "WORD" program, available from Microsoft Corporation. Many aspects of word processing programs have been extended to other types of computer application programs, for example, spreadsheets, project management programs, graphics programs, database programs, and the like. It is a requirement for these and many other types of computer programs that text, numbers, or other data stored in a document file be displayed in an attractive, formatted manner on a computer monitor, printed via an output device, or otherwise represented.
Many present day computer application programs have the ability to display or output information on output display devices in various formats, often in a form corresponding to the appearance of the data as it will be printed or otherwise output. For example, characters may be printed with any number of fonts, in various sizes, with the characters in boldface, underlined, italicized, centered, in sections, tables, etc.
In many computer application programs, information is represented by a "document". A document is what a user sees and edits. A document can change as the user types, makes formatting changes, adds and deletes text, etc. A document, also called a "document file", comprises a number of different data structures or sections that collectively represent a discrete quantity or unit of data for manipulation with the application program. For example, in a word processing program, a document file typically consists of a header defining file ranges for text and formatting information, a text data structure that stores text-based information, a property modifier structure for storing groups of property modifiers and corresponding arguments or parameters representing formatting information for application to the text, and a format structure containing information for linking the text in the data structure to the groups of property modifiers in the property modifier structure. The property modifiers (and their respective arguments) describe formatting applied to characters, paragraphs, sections, tables, and pictures in the document.
In this prior property modifier structure, formatting information is represented by an 8-bit pointer that constitutes a single property modifier or "sprm". The sprm indicates an offset address within a format "default" table that is stored in conjunction with the executable code of the application program. There is a default table in the executable corresponding to each different type of property, e.g., character, paragraph, table, section and picture. Because the default tables comprise a part of the executable file, they are "permanent" and cannot be modified by the user; these default tables merely serve as reference data containing formatting information that are applied to data items. Each entry in this type of default table consists of an argument size (a "single property argument" or "spra"), a group code (a single property group code or "sgc"), and a special status bit ("fSpec"). The spra indicates the size of parameter value associated with the sprm, which could be a 8-bit byte, a 16-bit word, a 32-bit long, or a variable length array of bytes in the executable. The sgc indicates a type or category of object to be formatted (e.g. character, paragraph, section, etc.). The fSpec status bit indicates whether or not the sprm needs special code to carry out its action.
Each entry in a default table applies a particular single form of formatting to a run of text, in accordance with the type of formatting to be applied, i.e., whether the run of text is a string of characters, a paragraph, a table, etc. In order to apply multiple items of formatting to a selected string of characters, plural sprm entries are provided in the prior property modifier structure. A group of sprm entries indicating a plurality of different formattings applied to a run of characters is indicated as a "group of property modifiers in a list" or "grpprl". Each sprm in a group points to a different entry in one or more of the default tables in the executable.
Turning now to a prior text formatting system used by "Microsoft WORD FOR WINDOWS 95" program, formatting information for an example text run will be examined in detail, as shown in Tables 1, 2 and 3. Table 1 generally describes the formatting for a sample text string, "The quick brown fox jumped over the lazy dog." The typical structure of a document file created in the prior word processing computer program, "Microsoft WORD FOR WINDOWS 95", is shown in Table 2. This document file contains formatting information and the related structures to support the formatting for the text string shown in Table 1. The typical structure of a default format table contained in executable code of the "Microsoft WORD FOR WINDOWS 95" program is shown in Table 3. This table contains default formatting information that supports the formatting for the text string shown in Table 1.
TABLE 1 ______________________________________ Text String ______________________________________ The quick brown fox jumped over the lazy dogs. wherein: All text is font size 10 "brown" is bold "over" is italic and has been made 2 sizes larger than the rest of the text ______________________________________
TABLE 2 __________________________________________________________________________ Document File FC Section Range Contents Description/Comments __________________________________________________________________________ header 0-1FF &lt;header information&gt; In this case, data range: 200-22D, format range: 400-42B data 200-209 The.sub.-- quick.sub.-- each character is one byte structure 20A-20E brown (text) 20F-21A .sub.-- fox.sub.-- jumped.sub.-- 21B-21E over 21F-22D .sub.-- the.sub.-- lazy.sub.-- dogs. 22E-3FF &lt;unused&gt; format text FC formatting FC each FC is a long (4 bytes) structure 400-407 200 600 408-40F 20A 604 410-417 20F 600 418-41F 21B 60A 420-427 21F 600 428-42B 22E (no formatting FC here) 42C--4FF &lt;unused&gt; property 600-603 03 count of bytes in 1st grpprl modifier 01 sprmCSize structure 000A (word-size) arg for sprmCSize 604-609 05 count of bytes in 2nd grpprl 01 sprmCSize 000A (word-size) arg: size = 10 03 sprmCBold 01 (byte-size) arg: bold = on 60A-611 07 count of bytes in 3rd grpprl 01 sprmCSize 000A (word-size) arg: size = 10 02 sprmCInc 02 (byte-size) arg: size += 2 04 sprmCItalic 01 (byte-size) arg: italic = on 612-6FF &lt;unused&gt; __________________________________________________________________________
TABLE 3 ______________________________________ Default Format Table sprm sgc spra fSpec b ______________________________________ sprmCSize (1) sgcChp (2) spraWord (2) FALSE (0) 0 sprmCInc (2) sgcChp (2) spraByte (1) TRUE (1) 0 sprmCBold (3) sgcChp (2) spraBit (0) FALSE (0) 2 sprmCItalic (4) sgcChp (2) spraBit (0) FALSE (0) 3 ______________________________________
Referring first to Table 1, the example text string is "The quick brown fox jumped over the lazy dogs." For this example text string, all text is font size 10, the term "brown" is bold, and the term "over" is italic and is two sizes larger than the remaining portion of the text. Consequently, the formatting attributes for this text string include a 10 point font size, bold, italic, and increased font size (by 2 sizes). These format attributes for the text string of Table 1 are defined in the structures of the document file of Table 2 and supported by the format information maintained in the property information array of Table 3.
Referring now to Table 2, a document file for the prior word processing program contains multiple structures including a header, a data structure, a format structure, and a property modifier structure. The header contains general information regarding the document file and defines the text range and the format information range for the data structure and the format structure. A File Character (FC) position represents an offset from the beginning of the document file. Consequently, the header section of the document file is defined by the FC range of 0-1FF. The text range for text maintained in the data structure is 200-22D. The linking information for linking the data of the data structure to the property modifiers of the property modifier structure is maintained within the format structure at 400-42B. For example, for the FC range of 400-407, the text beginning at FC range 200, "The quick", is associated with the group of property modifiers within the property modifier structure beginning at the FC range of 600.
In the file shown in Table 2, the formatting is specified using single property modifiers (sprms), also called property modifiers. For this "WORD 95" program example, the relevant property modifiers are directed to the formatting actions of defining a base font size, increasing this font's size, bold, and italic. These property modifiers and their values are listed below:
______________________________________ sprmCSize: character formatting to set font size; Value = 1 sprmCInc: character formatting to increase font size; Value = 2 sprmCBold: character forming to make text bold; Value = 3 sprmCItalic: character formatting to make text italic; Value = 4 ______________________________________
Each sprm takes an argument, and multiple sprms and their arguments can define formatting for a piece of text.
Groups of property modifiers in a list, also called a grpprl, are stored in the property modifier structure within the file at FC ranges 600-603, 604-609 and 60A-611. A set of grpprls represents the formatting information for the sample text stream "The quick brown fox jumped over the lazy dogs." For the text "The.sub.-- quick.sub.-- ", a grpprl at FC range 600-603 contains just one sprm and argument: sprmCSize, with its argument of 10 (because the text is size 10). For "brown", a grpprl at FC range 604-609 contains two sprm/argument pairs: sprmCSize, followed by its argument of 10; and sprmCBold, followed by its argument, TRUE. For "over", a grpprl at FC range 60A-611 contains three sprm/argument pairs: sprmCSize, 10; sprmCInc, 2 (increase size by 2); sprmCItalic, TRUE. Given a sprm of Table 2, the associated values for sgc, spra, fSpec, and b, which are stored in the executable of the application program, can be determined by accessing the default table shown in Table 3.
In prior versions of the Microsoft "WORD" program, sprm's were originally restricted to being byte-size. Because of the desire to keep these sprm values small, the sprms did not directly encode information about what property type was modified (for example, character, paragraph, table, etc.) or the size of the argument following the property modifier. Rather, each property modifier was merely an index into the default tables stored in association with the executable file of the application program that themselves encoded the formatting information.
Referring now to Table 3, a default format table maintained within the executable of the prior word processing program can be accessed by using a sprm value as an index to the table. This format table contains the fields for sgc, spra, fSpec, and b values, which are referenced by a corresponding sprm value. For example, the first entry in the default format table is accessed by the sprmCSize(1). This entry contains the following format-related information: sgc=sgcChp(2); spraWord(2); fSpec=FALSE(0); and b=0. The "b" value is an offset into a data type structure maintained in dynamic memory and can be used to find the location of a property to modify within that memory structure.
To support an application of the formatting information in the document file of Table 2 and the default table of Table 3, it is necessary to first locate the group of property modifiers associated with the text to be formatted, and then walk or "traverse" the group of property modifiers. For the example of the text "over", this text element is referenced by the FC range 21B-21E in the data structure of the file, as shown in Table 2. The format structure indicates that the particular group of property modifiers for the text starting at FC=21B is located within the property modifier structure at FC=60A. The first byte within this group of property modifiers is "07". This first byte defines the number of bytes in the particular group of property modifiers, i.e., seven bytes follow the byte count. The second byte within this group of property modifiers is "01". This is a sprm value, which can be used to index into the default format table shown in Table 3 to get the spra value, that defines the size of the argument for this property modifier. As shown in Table 3, the spra located at the offset "01" of the default table is "spraWord". The third and fourth bytes are "000A", which is the expected Word-sized argument for the property modifier. The fifth byte within this group of property modifiers, "02", is another sprm value. This sprm value is used to index into the default format table to get the spra value "spraByte". The sixth byte is "02", which is the expected Byte-size argument for this property modifier. The seventh byte, "04", is another sprm value. This sprm value is used to index into the default format table to get the spra value "spraBit". The eighth byte is "01", which is the expected Bit-size argument for the property modifier.
Significantly, if an application program did not recognize a sprm value shown in the file of Table 2, then the program would not be able to determine the size of the sprm argument by accessing the default table in the executable. This would prevent the application program from traversing the property modifier structure because the program would not recognize how to skip over the sprm argument to read the subsequent sprm's and their arguments in the property modifier structure.
With the above-described property modifier approach, a particular problem can arise when programmers are required to add new property modifiers when creating an updated version of the program. Place-holders have been employed in the default tables to reserve space for a predetermined number of property modifiers associated with a particular group code or "sgc". When the preallocated space for property modifiers was exhausted as new modifiers were added, a file format change was required to provide a new mechanism for allocating space for property modifiers in the default property tables. The file format change often caused documents created with the updated version of the program to be unreadable with prior versions of the program.
In prior versions of the Microsoft "WORD" program, a single 8-bit integer was used as a sprm. The application program used that value to index into the default table stored in association with the program executable. The result gave detailed information about the property, including the size of the parameter indicated by the spra and the object it should be applied to as derived from the sgc (e.g., character, paragraph, section, etc.). The information stored in the default table also included information needed to modify appropriate in-memory structures holding the actual formatting information. These 8-bit sprm integer values were divided into ranges; the range a property modifier was in determined what kind of object was modified indicated by the sgc, e.g., whether character, paragraph, section, table, or picture. As the program was updated, these ranges were periodically adjusted, and it was discovered that numbers were exhausted in some ranges but there were additional values available in other ranges.
When a new property modifier had to be added in a subsequent version of the application program, the old version did not necessarily have the formatting information in its default property file in the executable. Thus, an older version of the application program, if it attempted to open a document created with a newer version of the program, could not determine the size of a parameter or the object that should be formatted, as the file created with the newer version was incompatible with the older version.
In order to allow for backwards compatible changes to the file format, programmers found it necessary to preallocate slots in the default tables in the executable for future expansion. Once a particular version ran out of preallocated slots, it was then necessary to make a file format change--to increase the number of preallocated slots--in order to allow new property modifiers. Of course, this preallocation had to be done presently while the programmers were preparing program code for a prior version even before the programmers were instructed to work on the subsequent version! Needless to say, the foresight of many computer programmer was rarely good enough to preserve document compatibility in subsequent versions of the application program.
Another problem associated with the prior art approach resulted from the addition of new sprm table entries. A prior version of the application program could not handle or operate upon with a document created with a subsequent version of the application program because it did not "know" what to do with new sprm values added. In other words, sprms in the document created with the later version could not be handled by the prior version because there was no program code to handle it.
Furthermore, the prior version could not merely skip over the new values because there was no information indicating how big was the "value" part of the newly added sprm. Although the table entry in the newer version had a spra, the older version did not have a table entry for the new sprm, and therefore could not look up the spra value. Thus, the prior version of the program did not know how many bytes to skip over in the default property table to get to the next sprm. This was because the size of the value--the spra--was encoded in the table in the executable and not stored in the document itself.
Accordingly, there is a need to provide a method and system that enables documents created with a newer version of an application program to be properly handled by prior versions of the application program in a clean and efficient manner, by providing a mechanism for allowing the prior version of the application program to skip over formatting information that it does not handle. This would allow sites that maintain multiple versions of a particular application program to interoperate and share documents with minimum time lost to conversion between various application versions.